import { cn } from "@/utils/twMerge";
import { Table, Tag } from "antd";
import React from "react";

const Table1 = ({ data, title }: any) => {
  const columns = [
    {
      title: "姓名",
      dataIndex: "name",
    },
    {
      title: "考勤时间",
      dataIndex: "date",
    },
    {
      title: "考勤类型",
      dataIndex: "reason",
      render: (text: any) => <Tag color="red">{text}</Tag>,
    },
    {
      title: "部门",
      dataIndex: "partment",
      render: (text: any) => <Tag>{text}</Tag>,
    },
  ];
  return (
    <div className={cn(" w-full h-[400px] bg-white rounded-md p-4 ")}>
      <div className="flex-none text-xl h-10">{title}</div>
      <Table
        dataSource={data}
        columns={columns}
        pagination={false}
        scroll={{ y: 260 }}
      />
    </div>
  );
};

export default Table1;
